<script type="text/javascript" src="/js/order.js"></script>
<a href="/admin/tmp_orders_form/">тестовая форма</a>
<!--<table border=1>
	<tr>
		 <td>id</td> 
		 <td>Дата заказа</td> 
		 <td>Компания</td> 
		 <td>Наименование заказа</td> 
		 <td>Заказываемая дата</td> 
		 <td>Цена нетто</td> 
		 <td>Цена брутто</td> 
		 <td>Отправляющая</td> 
		 <td>Принимающая</td> 
	</tr>
	<?php foreach($list as $row){?>
	 <tr id='row_<?php echo  $row['id']?>' class='order_row'> 
		 <td><?php echo $row['id'] ?></td> 
		 <td><?php echo $row['date'] ?></td> 
		<?php if(isset($row['prinUser'])){ ?>	 <td><?php echo $row['prinUser'] ?></td><?php }?> 
		<?php if(isset($row['otprUser'])){ ?>	 <td><?php echo $row['otprUser'] ?></td> <?php }?> 
		 <td><?php echo $row['serviceName'] ?></td> 
		 <td><?php echo $row['datestart'] ?></td> 
		 <td><?php echo $row['price'] ?></td> 
		 <td><?php echo $row['clientprice'] ?></td> 
		 <td><?php echo $row['confirmOtpr'] ?></td> 
		 <td><?php echo $row['confirmPrin'] ?></td> 
	 </tr> 
	 <tr id='dop_row_<?php echo  $row['id']?>' style="display:none"> 
		 <td colspan=9> 
			 <table border=0 width=100%> 
				 <tr> 
					 <td width=100%> 
						<?php foreach($row['clients'] as $client){ ?>
						 <table width=100% border=0> 
							 <tr> 
								 <td width=200px>
								 	Фамилия Имя Отчество<br/>
								 	<input type=text size=50 value='<?php echo $client['fio'] ?>'>
								 </td>
								 <td width=155px>
								 	Телефон<br/>
								 	<input type=text width=200px value='<?php echo $client['phone'] ?>'>
								 </td>
								 <td>
								 	Email<br/>
								 	<input type=text value='<?php echo $client['email'] ?>'>
								 </td> 
							 </tr> 
							 <tr> 
								 <td></td><td>Гражданство</td>
								 <td><input type=text value='<?php echo $client['country'] ?>'></td> 
							 </tr> 
							 <tr> 
								 <td></td><td>№ паспорта</td>
								 <td><input type=text value='<?php echo $client['pasport'] ?>'></td> 
							 </tr> 
							 <tr> 
								 <td></td><td>Возраст</td>
								 <td><input type=text value='<?php echo $client['age'] ?>'></td> 
							 </tr> 
						 </table> 
						<?php } ?>
					 </td> 
				 </tr> 
				 <tr> 
					 <td > 
						 <table> 
							<?php foreach ($row['options'] as $option){?> 
							<tr>
							 	<td><?php echo $option['name']?></td>
							 	<td><input type=text value='<?php echo $option['value']?>'></td>
							</tr>
							<?php }?>
						 </table> 
					 </td> 
				 </tr> 
				 <tr>
				 	<td>
				 		<table>
					 		<tr>
					 			<td colspan=3>Размещение</td>
					 		</tr>
					 		<tr>
					 			<td >Комнат:</td>
					 			<td colspan=2><input type=text value='<?php echo count($row['rooms'])?>'></td>
					 		</tr>
					 		<tr>
					 			<td>Тип</td>
					 			<td>Ребенок</td>
					 			<td>Ужин</td>
				 			</tr>
							<?php foreach($row['rooms'] as $room){?>
							<tr>
								<td><?php echo $room['type']?></td>
								<td><?php echo $room['chld']?></td>
								<td><?php echo $room['hb']?></td>
							</tr>
							<?php }?>
				 		</table>
				 	</td>
				 </tr>
			</table>
		</td>
	</tr>
	<?php }?>
</table>-->
<table border=1>
		<th>№</th>
		<th>ФИО</th>
		<th>pdf</th>
		<th>notSpam</th>
		<th>checkOne</th>
		<th>checkTwo</th>
<?php
	//exit (print_r($list));
	foreach ($list as $val){
?>
<tr>
	<td><?php echo $val['id']; ?></td>
	<td><?php echo $val['userName']?></td>
	<td><a href="/orders/<?php echo $val['guid']?>.pdf">Заказ (.pdf)</a></td>
	<td><?php echo ($val['notSpam'] == 1) ? '+' : '-';?></td>
	<td><?php echo ($val['checkOne'] == 1) ? '+' : '-';?></td>
	<td><?php echo ($val['checkTwo'] == 1) ? '+' : '-';?></td>
</tr>
<?php
	}
?>
</table>